<template>
	<view class="contentshare">
        <scroll-view
        :style="'height:'+height+'px;'"
        	class="list-scroll-content " 
        	scroll-y
        	@scrolltolower="getlist" 
        >
		<view class="shareorder" v-for="items in list">
			<view class="share-top">
				<text>邀请{{items.user.nickname}}购买的商品  </text> 
					
			</view>
			<view class="" style="display: flex; shaer-info">
				<image style=" flex: 0 0 25%;height: 100px;" :src="items.item.item_image" mode=""></image>
				<view class="">
					<text style="height: 34px;ont-size: 13px; color: #333; overflow: hidden;">{{items.order_title}}</text>
				<!-- 	</br><text style="    font-size: 12px;color: #b2b2b2;padding: 7px 0;display: inline-block;">
											
					规格 ：1.5m*2m 床+床垫+床头柜*2
					</text> -->
					<view class="share-top" style="font-size: 14px;">
						<text style="color: #f00;">{{items.item.item_price}}</text>
						<text>{{items.order_item_num}}</text>
					</view>
					 
					
					<view style=" display: flex;
  justify-content: flex-end;">
						
						<text style="font-size: 12px;">共{{items.order_item_num}}件商品  合计：{{items.order_total}} </text>
					</view>
				</view>
				
			</view>
			<view class="share-top" >
				<!-- <text>预计收益：￥66</text> -->
				<text style="font-size: 15px;padding: 7px 0;display: inline-block;"> {{items.order_ship_status === 'SUCCESS'? '已到账':'待到账'}}  </text>
                <text style="font-size: 12px;padding: 7px 0;display: inline-block;">下单时间：{{items.created_at}}</text> 
				<!-- <text>订单号:2019111104126</text> -->
			</view>
		</view>
        <uni-load-more :status="loadingType"></uni-load-more>
        </scroll-view>
	</view>
</template>

<script>
   import {getOne} from '../../api/publicapi.js'
   import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
   export default {
       components: {
            uniLoadMore
       },
	   data() {
			return {
				user:null,
                list:[],
                height:0,
                loadingType:'more',
                page:1
			}
		},
        onLoad() {
            let that =this
            // that.getaddressdata()
            uni.getSystemInfo({
                success: function (res) {
                    console.log(res)
                        that.height = res.windowHeight
                
                }
            });

          this.getlist()  
        },
		methods: {
        
			getlist(){
                if(this.loadingType === 'loading' || this.loadingType === 'noMore' ){
                	//防止重复加载
                	return;
                }
                
                this.loadingType = 'loading';
                getOne('front/user/getmerchant',{page:this.page}).then(res=>{
					console.log(res.data.data);
                   if (res.data.data !== undefined) {
                       if(res.data.data.length>0){
                           this.page += 1
                           for (var i = 0; i < res.data.data.length; i++) {
                            
                              this.list.push(res.data.data [i]) 
                           }
                        this.loadingType = 'more'
                       }else{
                         this.loadingType = 'noMore';
                       }
                   				
                   } else {
                        this.loadingType = 'noMore';
                   	msg(res.data.message)
                   }
                })
            }
		}
	}
</script>

<style lang="scss">
	.contentshare{
		width: 100%;
		padding: 0px 10px;
		font-size: 26rpx;

		
	},
	.shareorder{
		width: 93%;
		background: #fff;
		border-radius: 10px;
		margin: 13px auto 0;
		-webkit-box-shadow: 0 3px 4px #e2e2e2;
		box-shadow: 0 3px 4px #e2e2e2;
		padding: 0px 10px;
	}
	.share-top{
		display: -webkit-box;
		display: -ms-flexbox;
		display: flex;
		-webkit-box-pack: justify;
		-ms-flex-pack: justify;
		justify-content: space-between;
		padding: 15px 0;
		
	}
	.shaer-info{
	  display: flex;
	  justify-content: space-between;
	}
	
	
	
</style>
